package com.spice.service.entity.enums;

import lombok.Getter;
import lombok.ToString;


@ToString
public enum JobStatusEnum {

    NULL("尚未初始化", false),
    INITIALIZING("正在初始化", false),
    INIT_FAIL("初始化失败", false),
    READY("初始化完毕准备就绪", false),
    RUNNING("正在运行", false),
    SUCCESS("运行成功", true),
    FAILURE("运行失败", true);

    @Getter
    private String massage;
    private Boolean isDone;

    JobStatusEnum(String message, boolean isDone) {
        this.massage = message;
        this.isDone = isDone;
    }

    public Boolean isNull() {
        return this.equals(NULL);
    }

    public Boolean isReady() {
        return this.equals(READY);
    }

    public Boolean isSuccess() {
        return this.equals(SUCCESS);
    }

    public Boolean isDone() {
        return this.isDone;
    }
}
